<template>
  <div>
    <div class="fenlei_box">
      <div
        v-for="(item,index) in type.imgUrls"
        :key="index"
        :class="type.stylesType !== 2 ?'fenlei_box_one' : 'fenlei_box_two'"
        @click="feileidetail(item)"
      >
        <div class="fenlei">
          <!-- @click="gotype(item,index)" -->
          <img
            :src="item.src"
            alt
          >
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['type'],
  data () {
    return {}
  },
  created () {
    if (this.type.stylesType === 2) {
      this.type.imgUrls = this.type.imgUrls.slice(0, 6)
    }
    // console.log('接受数据',this.type)
  },
  methods: {
    //     gotype (item) {
    //       console.log(`bbbbbbbbbbbbb`)
    //     },
    feileidetail (item) {
      // console.log('item', item)
      this.$emit('feileidetail', item)
    }
  },
  components: {}
}
</script>
 <style lang="less" scoped>
.fenlei_box {
  width: calc(100vw * 686 / 750);
  margin: 0px auto;
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: space-between;
  align-content: space-between;
  align-items: center;
  padding-bottom: calc(100vw * 20 / 750);
}
.fenlei_box_one {
  display: inline-block;
  width: calc(100vw * 160 / 750);
  height: calc(100vw * 160 / 750 * 100 / 160);
  overflow: hidden;
  margin-bottom: 5px;
}
.fenlei_box_two {
  width: calc(100vw * 218 / 750);
  height: calc(100vw * 86 / 750);
  margin-bottom: 5px;
  border-radius:  calc(100vw * 4 / 750);
  overflow: hidden;
  .fenlei {
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-size: 100% 100%;
  }
  .fenlei > img {
    width: 100%;
    height: 100%;
  }
}
.fenlei {
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: 100% 100%;
   border-radius:  calc(100vw * 4 / 750);
}
.fenlei > img {
  width: 100%;
  height: 100%;
}
</style>
